Skip to main content

Full text of "Musical Instruments"

See other formats

Arduino Theremin 

Make] Projects 

hhiiilH ho/ 1 !/ tuMaal/ chare r\icf*f\\tat* 

build, hack, tweak, share, discover,- 

Arduino Theremin 

Written By: Alan 


• Hot Glue gun & hot glued) 
Soldering iron (1) 
Super glue (1) 


Arduino microcontroller, Uno or 
Duemilanove (1) 

Breadboard kit (1) 

3- 16V Piezo Buzzer (RadioShack #273- 

074) (1) 

VEX Ultrasonic Range Finder (1) 

CdS Photoresistor (1) 

1 0K Resistor (1) 

Potentiometer. 5kQ. audio taper (1) 

Servo (generic) (1) 

Circuit board header: 3-pin (1) 

Breadboard jumper wires, or solid core 

22AWG wire (Many) 
Many colours 

Wire (A few) 
Many Colours 

Rubber bands (A few) 

Dowel. 3/8" dia. 1/2" length (1) 
Or near 

Sandpaper (1) 
Strip. 1/2" x 2" 


If you want to make music, then this project is for you. This is a theremin-like device to 

© Make Projects 

Page 1 of 4 

Arduino Theremin 

control the pitch and volume of a musical note. It utilizes a photo-resistor to control the 
pitch, and an ultrasonic sensor to control a servo which turns a potentiometer controlling the 

© Make Projects Page 2 of 4 

Arduino Theremin 

Step 1 — Connect the servo and potentiometer. 

• Solder wires onto the potentiometer. I used red for the audio voltage in on the left and 
green for the voltage out in the center. 

• I initially soldered on a black wire on the third pin, but removed it as it was redundant. 

• Hot glue the dowel onto the servo, centered, and then super glue the sandpaper to the 
dowel to provide traction for the rubber band. 

• Find a rubber band, preferably wide, that can be used to transfer the servo motion to the 

• Hot glue the potentiometer in place. Don't be sparing with the hot glue, as it is not terribly 

• Turn both the potentiometer and servo all the way to the left and link them together with the 
rubber band. I had to use several as the servo shifted while the glue was cooling. 

© Make Projects 

Page 3 of 4 

Arduino Theremin 

Step 2 — Wire that Arduino. 


s i a s r r *-5|E 

i I ■ 

f? ii!!!! 

r I: [-[[:[[:[: I i 1: |, 1; 1 I 



• Supply +5V to the power rail on the breadboard, and then to the power pin on each 
ultrasonic sensor, the servo power pin, and the photo-resistor. 

• Supply GND to the GND rail on the breadboard, and then to the ground pin on each 
ultrasonic sensor, the servo ground pin, and the piezo buzzer ground pin. 

• I used analog for the photo-resistor output, digital 10 for the servo, digital 2 for the 
ultrasonic output, and digital 8 for the ultrasonic input 

• Use a 10kQ resistor as a pull-down for the photo-resistor by connecting it to GND and 
analog 0, or whatever analog pin you end up connecting the photo-resistor to. 

Step 3 — Code the Arduino. 

t Edit Standi Tools H* 

■vi ulcxuwHc tenttc T* ctr.tcel (Jie valine, and a phowietlatAc w 
eentcvl Uit pi cch. THe pi cub ij controlled directly ly Use 
JlcduliWj vReceaa cne ■-"ji'.^-j u >:ar.L >:_-;••_ Lv i jec<--o chanaicw the 
position «1 a pcatntineui, iaci«**ir^ ee daectailBe. Ch* uolug*- 

Cisevtt 3«Ihmc1c: 

Dllca^dnlt Input — 14 
Dlcxuantc Ouipux " fci 

ftlEiktC * - M 

Sti»» pull* — iUt 


llm U1*E 

fUKlMOt <1MUMC«> //f UIMltHl aE*llM Ul«M«l>iC Ubt»tV 

Ultcascmir ultrasonic (Sj-2) ; .'.- 

:;^:^:;o!'^^ utpln " 

--Old aetavQ) 

Serial. begiucM**!.; //mi tail 
Serial, pt uiilrH'ctmikg- . ."|: 

«, .=11 -ai^ l„, IMMUMtatf 

, —.— t"l^ '*-*"" » 

'.-Old lwp[] 

int dlsb - I!; J,'05iim vaclaWe and iIiiut value toi ulHaaoois va 
at» - ultliHOIalCfanvMVlCIII; /yfeWTiei dltUIWt (iJ» MiSLW<.rtH 

int ligjit ■ 512; 

• See attached file, theremin.pdf, 

for the code. 

• The volume should increase as 
your hand is moved closer to the 
ultrasonic sensor, so if the 
opposite happens, simply reverse 
the mapping of the servo position. 

• To do this, change the code from 

rad = map(dist, 8, 20, 0, 
90);tOrad = map(dist, 8, 
20, 90, 0); 

This document was last generated on 201 3-02-1 4 01 :46:07 AM. 

© Make Projects 

Page 4 of 4